import request from '@/utils/request'

// 查询分批计费(应收)详细
export function getBilling(id) {
  return request({
    url: '/finance/billing/' + id,
    method: 'get'
  })
}

// 新增分批计费(应收)
export function addBilling(data) {
  return request({
    url: '/finance/billing',
    method: 'post',
    data: data
  })
}

// 修改分批计费(应收)
export function updateBilling(data) {
  return request({
    url: '/finance/billing',
    method: 'put',
    data: data
  })
}

// 获取收款总额
export function getSumAmount(id){
  return request({
    url:'/finance/billing/accountsReceivableId?accountsReceivableId='+id,
    method:'get',
  })
}

// 根据id查询一条计费记录
export function getBillingById(id) {
  return request({
    url: '/finance/billing/byId?id=' + id,
    method: 'get'
  })
}

// 上传附件
export function uploadOther(data){
  return request({
    url:'/finance/billing/other',
    method:'post',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    data: data
  })
}